#ifndef __SPEED_MEASURE_H
#define __SPEED_MEASURE_H

#include "mytype.h"

#ifdef __cplusplus
extern "C"
{
#endif

	typedef struct
	{
		uu32 tick_max;			
		uu32 cap_clk;			
		uu32 *cap_data_list;	
		uu8 cap_list_len;		
		uu8 cap_data_index;		
		uu8 cap_ready;			
		uu8 st_tover;			
		uu32 cap_val_old;		
		uu32 speed;				
		uu32 (*tick_get)(void); 
	} speed_measure_type;

	void speed_measure_init(speed_measure_type *obj);

	void speed_measure_timer_monitor(speed_measure_type *obj);

	void speed_measure_cap(speed_measure_type *obj);

	uint32_t cap_speed_cal(speed_measure_type *obj);

	typedef struct
	{
		uu16 *pulse_list;	  
		uu8 pulse_list_len;	  
		uu8 pulse_list_index; 
		uu8 cap_ready;		  
		uu32 speed;			  
	} speed_c_measure_type;

#ifdef __cplusplus
}
#endif

#endif 
